<?php
/**
 * Notes:
 * Created by PhpStorm.
 * Author: TS
 * Date: 2019/10/26
 * Time: 18:43
 */

namespace app\model;


use think\Model;

class RuleGroup extends Model
{
   public function getById($rule_group_id){
       return self::get($rule_group_id);
   }
   public function getAll(){
       return self::select();
   }
   public function add($data){
       return self::create($data);
   }
   public function edit($rule_group_id,$data){
       return self::update($data,['rule_group_id'=>$rule_group_id]);
   }

   public function checName($rule_group_name){
       return self::get([
           'rule_group_name' => $rule_group_name
       ]);
   }
    public function getRuleAddTimeAttr($value){
        return date('Y-m-d H:i',$value);
    }



}